#include <QtGui/QApplication>
#include <QLocale>
#include "mainwindow.h"

// Tesing!
#include "logfileparser.h"
#include "sessionextractor.h"
#include "basket.h"
#include "app.h"

#include "fptree.h"
#include "fptreenode.h"

int main(int argc, char *argv[])
{

    //QApplication a(argc, argv);
    //MainWindow w;
    //w.show();

    App app;
    app.setFilename("/home/discovery/pl/ED/small.txt");
    //app.setFilename("/home/discovery/pl/ED/access_log_Aug95_utf8");
    app.setOneHostOneUser(true);
    app.setPopularPagesSize(40);
    app.setSessionDuration(60*20);
    app.run();

    /* Computation time

QDateTime("wt. mar 27 01:56:42 2012")
"/home/discovery/pl/ED/access_log_Aug95_utf8"
Pointer stream has been alocated.
QDateTime("wt. mar 27 04:42:15 2012")
==============================

      */

    // Some testing

    /*QStringList a1;
    a1.append("orzeszki");
    a1.append("coca-cola");

    QStringList a2;
    a2.append("orzeszki");
    a2.append("piwo");
    a2.append("pieluszki");

    QStringList a3;
    a3.append("coca-cola");

    QStringList a4;
    a4.append("orzeszki");
    a4.append("piwo");
    a4.append("coca-cola");

    QStringList a5;
    a5.append("orzeszki");
    a5.append("piwo");
    a5.append("pieluszki");

    FPTree *tree = new FPTree;
    tree->addPages(&a1);
    tree->addPages(&a2);
    tree->addPages(&a3);
    tree->addPages(&a4);
    tree->addPages(&a5);

    tree->showTree();*/

    /*QStringList pp;
    pp.append("/");
    pp.append("/images/");
    pp.append("/images/apollo/");
    pp.append("/images/apollo/13/");

    QStringList tt;
    tt.append("/");
    tt.append("/images/");
    tt.append("/images/cassini/");
    tt.append("/images/apollo/13/");

    QStringList pp1;
    pp1.append("/");
    pp1.append("/images/");
    pp1.append("/images/apollo/");
    pp1.append("/images/apollo/11/");

    QStringList pp2;
    pp2.append("/");
    pp2.append("/images/");
    pp2.append("/images/apollo/");
    pp2.append("/images/apollo/14/");

    FPTree *tree = new FPTree;
    tree->addPages(&pp);
    qDebug() << "-------";
    tree->addPages(&tt);
    tree->addPages(&pp1);
    tree->addPages(&pp2);

    qDebug() << "###############";

    //tree->debug();
    tree->showTree();*/
    //return a.exec();
}
